1. Field of the Invention
The present invention relates to a coding apparatus for use with an apparatus for transmitting or recording and reproducing a variety of information, for example, video and audio signals or the like.
2. Description of the Prior Art
A variety of video signal coding apparatus have hitherto been proposed to transmit or record an image at a bit rate as low as possible with a sufficiently high picture quality. For example, there has been known a high-efficiency coding apparatus using a DCT (discrete cosine transform) and Huffman coding.
In conventional coding apparatus, data, such as video and audio data, to be coded is converted into coefficient data by a discrete cosine transform (DCT) circuit, for example, at every block from a DC component to a high-order AC component. The coefficient data is then quantized and subsequently coded by a variable length coder.
The DCT circuit converts the frequency component data, from a DC component, to a high-order AC component of the blocked data into two-dimensional coefficient data. The converted coefficient data is scanned (in a so-called zigzag scan fashion) and then coded, as shown in FIG. 1. Coding is carried out in accordance with the scanning order, and the coefficient data of the last coefficient which becomes non-zero after quantization lies within the coding range.
Coefficient data obtained within the coding range by the zigzag scanning are arrayed in a line as shown in FIG. 2, for example. The coefficient data thus arrayed are coded by the variable length coder according to a suitable method, such as the Huffman coding method or the like. U.S. Pat. No. 4,901,075 describes the Huffman coding technique.
In FIG. 2, DC represents the DC component coefficient data ("168" in this example), and AC01 through AC33 represent AC component coefficient data. The AC component coefficient data becomes high-order as their reference numeral increase. As shown in FIG. 2, the DC component coefficient data DC to the high-order AC component coefficient data ACC33 are coded as codes C1 to Cn, in that order. Also, as shown in FIG. 2, when coefficient data are coded, they are coded as a unit of consecutive "0"s and the succeeding value. In the following description, "0 run" means the number of consecutive "0"s. The expression of "0 run 0" shows that the length of the "0 run" is "0", i.e., there exists no "0".
In FIG. 2, AC component coefficient data AC20is "0", the next AC component coefficient data AC11 is "0", the next AC component coefficient data AC02 is "0" and the next AC component coefficient data AC03 is "4", which therefore will be referred to as "0 run 3, value 4". AC component coefficient AC01 is "120" and therefore will be referred to as "0 run 0, value 120".
How to code the coefficient data shown in FIG. 2 will be described below with reference to FIG. 3. FIG. 3 is a table to which reference will be made in assigning codes in response to the 0 run length and the value following the string of "0"s. To understand the prior art more clearly, FIG. 3 illustrates only 0 run lengths and their succeeding coefficient values. The table shown in FIG. 3 is made in accordance with the conventional Huffman code forming procedure.
AC component coefficient data AC01 is "120" as shown in FIG. 2, and described as "0 run 0, coefficient value 120" as shown in FIG. 3. Therefore, a variable length code C1 is assigned thereto, for example. AC component coefficient data AC10 is "50" as shown in FIG. 2, and described as "0 run 0, coefficient value 50" in FIG. 3. Therefore, a variable length code C2 is assigned thereto, as shown in FIG. 3.
The next AC component coefficient data AC20is "0", the AC component coefficient data AC11 is "0", the AC component coefficient data AC02 is "0" and the succeeding AC component data AC03 is "4", i.e., three consecutive "0"s are followed by "4", which is, a non-zero coefficient. In this case, as shown in FIG. 3, "0 run 3, coefficient value 4" is established and a variable length code C3 is assigned thereto. Similarly, AC component coefficient data AC12 is "0", the AC component coefficient data AC21 is "0", and the succeeding Ac component coefficient data AC30 is "3". In this case, as shown in FIG. 3, "0 run 2, coefficient value 3" is established and a variable length code C4 is assigned thereto.
Subsequently, AC component coefficient data AC31 is "1" and "0 run 0, coefficient value 1" is established as shown in FIG. 3. Thus, a variable length code C5 is assigned thereto. AC component coefficient data AC22 is "0", the AC component coefficient data AC13 is "0" and the succeeding AC component coefficient data AC23 is "1". In this case, as shown in FIG. 3, "0 run 2, coefficient value 1" is established and a variable length code C6 is assigned thereto. AC component coefficient data AC32 is "1", therefore, "0 run 0, coefficient value 1" is established and a variable length code C7 is assigned thereto. Similarly, AC component coefficient data AC33 is "1", so "0 run 0, coefficient value 1" is established, as shown in FIG. 3, and a variable length code C8 is assigned thereto.
As described above, in the conventional coding apparatus, the coding range of the coefficient data is determined by scanning from the DC component to the high-order AC component of the coefficient data obtained from the DCT circuit in a zigzag scanning fashion. Coefficient data which falls in the coding range are arrayed in a line in the order of zigzag scanning. Then, the coefficient data thus arrayed are coded based on the table made in accordance with the Huffman code forming procedure, i.e., a table formed of the number of consecutive "0"s and codes corresponding to the values of non-zeros following the consecutive "0"s.
The assignee of the present application has previously proposed the data transmission apparatus (see U.S. Pat. No. 5,006,931) which will be described below.
According to the previously-proposed data transmission apparatus, a two-dimensional image block formed of (n.times.n) pixels is coded by a suitable code conversion method, such as a cosine transform or the like. The DC component obtained by the coding is transmitted in a predetermined bit number. The (n square-1) AC components are divided into (m.times.m) (n&gt;m) sub blocks. Address information of a sub block having purposive data and purposive coefficient data within the sub block are transmitted (for each sub block), whereby a transmission data amount can be made smaller than a predetermined target value under feedforward control.
Furthermore, according to the previously-proposed data transmission apparatus, a two-dimensional image block formed of (n.times.n) pixels is coded by a suitable code conversion method, such as a cosine transform or the like. The DC component obtained by the coding is transmitted in a predetermined bit number. The frequency with which (n square-1) AC components occur in the unit period, such as one field, one frame or the like, is detected. Then, the frequency of occurrence detected is converted into accumulative distribution data and the amount of data generated during the unit period is controlled so as to be smaller than a target amount of transmission data by using the accumulative distribution data (see U.S. Pat. No. 5,006,931).
As described above, in the conversion coding, such as a DCT or the like, coefficient data from low-order coefficient data to high-order coefficient data within the block are scanned in a zigzag fashion and consecutive "0"s and numbers other than "0" are formed as a group to which codes that are uniquely determined are assigned. Also in the subband coding, it is customary that codes which are uniquely determined are assigned to a group of consecutive "0"s within the band or between the bands and consecutive coefficients.
According to the aforesaid methods, when there are many consecutive "0"s efficient coding is possible. However, when there are not many consecutive "0"s, efficient coding is not possible.